<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="serviceurl" value="${ctx}/stwy/report" />
<html>
<head>
<title>report</title>
<link href="${ctx}/assets/rap/css/rap-report.css" rel="stylesheet" type="text/css"/>
<script src="${ctx}/assets/components/echarts-2.2.3/dist/echarts-all.js"></script>
</head>
<body>
	<div class="container-fluid rap-page-content">
		<div class="rap-page-area" id="rap-page-area-list">
			<div class="rap-searchbar">
				<form  id="rap-form-query" class="form-inline">
					
				</form>
			</div>
			<div class="" id="table1">
			</div>
			<div class="rap-echarts" id="chart1" style="height: 350px;width:1000px;">
			</div>
			<div class="" id="table2">
			</div>
			<div class="rap-echarts" id="chart2" style="height: 350px;width:1000px;">
			</div>
		</div>
		<!-- 非服务器分页脚本 -->
		<%@include file="/WEB-INF/views/common/table_script.jsp"%>
	</div>
		
	<script type="text/javascript">
	var _echart1 = echarts.init(document.getElementById('chart1'));
	var _echart2 = echarts.init(document.getElementById('chart2'));
	//扇形统计配置信息
	var option1 = {
		
	};
	//柱形统计配置信息
	var option2 = {
		
	};
	var _url =  '${serviceurl}/loadReport8';
	function appendQueryForm(){
		var queryBtnHtml = '<div class="form-group rap-searchbar-btn">'
							+'<button type="button" id="rap-btn-quickquery" onclick="onQuery();" > 刷新</button> '
							//+'<button type="button" > 清空</button>'
							//+'<button type="button" id="rap-btn-export" onclick="onExportReport();"><i class="fa fa-file-excel-o"></i> 导出</button>'
						+'</div>';
		$("#rap-form-query").html(queryBtnHtml);
		_rapui.setUIStyle(); 
	}
	function onQuery(){
		$.ajax({
			type : 'post',
			url : _url,
			dataType : 'json',
			success : function(data) {
				_echart1.clear();
				_echart2.clear();
				if(data.success){
					var obj  =  data.records[0];
					
					var div1 = $("#table1")[0];
					var div2 = $("#table2")[0];
					clearContainer(div1);
					_container=  div1;
					drawTable(obj.table1);
					
					clearContainer(div2);
					_container=  div2;
					drawTable(obj.table2);
					
					option1=obj.chart1;
					option2=obj.chart2;
					_echart1.setOption(option1);
					_echart2.setOption(option2);
					
				}else{
					alert(data.msg);
				}
			}
		});
	}
	function onExportReport(){
		
	}
	$(document).ready(function() {
		appendQueryForm();
		onQuery();
	});
	</script>
</body>
</html>